//
//  BBConfigurationController.h
//  BBTouch
//
//  Created by ben smith on 5/30/08.
//  This file is part of BBTouch.
//
//  BBTouch is free software: you can redistribute it and/or modify
//  it under the terms of the GNU Lesser General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.

//  BBTouch is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU Lesser General Public License for more details.

//  You should have received a copy of the GNU Lesser General Public License
//  along with BBTouch.  If not, see <http://www.gnu.org/licenses/>.
// 
//  Copyright 2008 Ben Britten Smith ben@benbritten.com .
//

#import <Cocoa/Cocoa.h>

// this is a shared object, it handles the configuration of the 
// blob tracking/detecting system


@interface BBConfigurationController : NSObject {
	NSSize rawImageSize;
	NSMutableDictionary * configurationSettings;
	IBOutlet NSArrayController * libraryController;
	NSMutableArray * configurationLibrary;
	IBOutlet NSTextField * configNameField;
	IBOutlet NSWindow * tuioSheet;
	IBOutlet NSWindow * mainWindow;
	IBOutlet NSWindow * screenSheet;
	IBOutlet NSWindow * archiveSheet;
}


@property (retain) 	NSMutableDictionary * configurationSettings;

-(IBAction)addNewConfig:(id)sender;
-(IBAction)loadConfig:(id)sender;



-(IBAction)openTUIOSheet:(id)sender;
-(IBAction)endTUIOSheet:(id)sender;
-(IBAction)openScreenSheet:(id)sender;
-(IBAction)endScreenSheet:(id)sender;
-(IBAction)openArchiveSheet:(id)sender;
-(IBAction)endArchiveSheet:(id)sender;

+ (BBConfigurationController*)sharedConfigurationController;
+ (BOOL)boolForSettingKey:(NSString*)key;
+ (NSInteger)intForSettingKey:(NSString*)key;
+ (NSMutableDictionary*)configurationSettings;
+ (id)objectForSettingKey:(NSString*)key;
+ (void)setObject:(id)object forSettingKey:(NSString*)key;
- (IBAction)openSaveConfigurationPanel:(id)sender;
- (NSArray*)allowableRawImageSizes;
- (NSSize)rawImageSize;
- (void) dealloc;
- (void)awakeFromNib;
- (void)loadDefaultConfiguration;
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context;
- (void)saveDefaultConfiguration;
- (void)setDefault:(id)obj forKey:(id)key;
- (void)setInitialDefaults;
- (void)setRawImageSize:(NSSize)aSize;

// 17 methods



@end
